/*************
Ten tac gia : LY THIEN KIM
Ngay tao : 8/16/2011
Noi dung : update 1 MENU

*************/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE NAME = 'sp_UpdateMENU')
BEGIN
	DROP PROC sp_UpdateMENU
END
GO
CREATE PROC sp_UpdateMENU
	@ID				int,
	@NAME			varchar(40),
	@Last_updated	datetime,
	@Result			int out
	AS
	BEGIN	
		IF EXISTS (SELECT * FROM SYS_MENU WHERE ID = @ID)
		BEGIN
			UPDATE SYS_MENU SET  NAME = @NAME,Last_updated = @Last_updated
			WHERE ID = @ID 
			SET @Result = 1	
		END
		else
		BEGIN
			SET @Result = 0
		END
	END